<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div ondblclick=""></div>
</body>
<script>
    let dep = {
        list: {},
        on: function (type, fn) {
            if (!this.list[type]) {
                this.list[type] = []
            }
            this.list[type].push(fn)
        },
        emit: function (type, ...params) {
            this.list[type].forEach(event => {
                typeof event === 'function' ? event.apply(null, params) : null
            });
        }
    }
    dep.on('click', (a) => {
        console.log(1111);
        console.log(a);
    })
    dep.on('click', (a) => {
        console.log(12345);
        console.log(a);
    })
    dep.on('dblclick', function () {
        console.log(2222);
        const count = [].reduce.call(arguments, (total, curr) => (total + curr), 0)
        console.log(count);
    })
    dep.emit('click', 999)


</script>

</html>